<?php

define('REP_ROOT', '');
require(REP_ROOT . 'config.php');

if(!isset($_SESSION['id_user']))
    redirectFront('connexion');

if(!isset($_POST['id']))
    redirectFront('profil');

$id_discussion = $_POST['id'];

if(isset($_POST['submit'])) {
	$language_folder = $_SESSION['language_code']==language_default?'':'/'.$_SESSION['language_code'];
    modelReportingDiscussion::newReponse($id_discussion, $_POST['message']);
    redirectFront($language_folder.'/profil-message-lire', 'id='.$id_discussion);
}
?>